namespace RivercrabNet
{
    using System;
    using System.Drawing;

    public class LineShape : BaseShape
    {
        private string displayName = string.Empty;
        private Brush lineBrush;
        private Color lineColor;
        private Pen linePen;
        private Brush transParentLineBrush;

        ~LineShape()
        {
            if (this.linePen != null)
            {
                this.linePen.Dispose();
            }
            if (this.lineBrush != null)
            {
                this.lineBrush.Dispose();
            }
            if (this.transParentLineBrush != null)
            {
                this.transParentLineBrush.Dispose();
            }
            if (this.linePen != null)
            {
                this.linePen.Dispose();
            }
        }

        public string DisplayName
        {
            get
            {
                return this.displayName;
            }
            set
            {
                this.displayName = value;
            }
        }

        public Brush LineBrush
        {
            get
            {
                return this.lineBrush;
            }
            set
            {
                this.lineBrush = value;
            }
        }

        public Color LineColor
        {
            get
            {
                return this.lineColor;
            }
            set
            {
                this.lineColor = value;
                if (this.linePen != null)
                {
                    this.linePen.Dispose();
                }
                this.linePen = new Pen(value);
                if (this.lineBrush != null)
                {
                    this.lineBrush.Dispose();
                }
                this.lineBrush = new SolidBrush(value);
                if (this.transParentLineBrush != null)
                {
                    this.transParentLineBrush.Dispose();
                }
                this.transParentLineBrush = new SolidBrush(Color.FromArgb(100, value));
            }
        }

        public Pen LinePen
        {
            get
            {
                return this.linePen;
            }
            set
            {
                this.linePen = value;
            }
        }

        public Brush TransParentLineBrush
        {
            get
            {
                return this.transParentLineBrush;
            }
            set
            {
                this.transParentLineBrush = value;
            }
        }
    }
}

